home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 14964 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  812 b 

  1. Path: uwm.edu!caen!hasdi
  2. From: hasdi@news-server.engin.umich.edu (HASDI RODZMANN HASHIM)
  3. Newsgroups: alt.msdos.programmer,comp.lang.c,comp.lang.pascal.misc
  4. Subject: typecasting preferences
  5. Date: 16 Apr 1996 11:58:08 GMT
  6. Organization: University of Michigan Engineering, Ann Arbor
  7. Message-ID: <4l020g$i9j@srvr1.engin.umich.edu>
  8. NNTP-Posting-Host: mi.engin.umich.edu
  9. X-Newsreader: TIN [version 1.2 PL2]
  10.  
  11. Hi guys! I think my earlier post got lost so here it is again.... This is
  12. for a student compiler project of mine.... 
  13.  
  14. If you have a choice, do you want the parethesis pair over the caster
  15. (C-style) or over the castee (Pascal-style)? eg...
  16.  
  17. int a;
  18. float b;
  19.  
  20. a = (int)b; /* cast to int */
  21. a = int(b); /* allowable in C++ */
  22.  
  23. ...as for Pascal...
  24. a := integer(b); { "a" in an integer and "b" is a real }
  25.  
  26. Thanx!
  27.  
  28.